/*
 * @Description:
 * @Version: 2.0
 * @Autor: snzo.chen
 * @Date: 2023-11-28 17:14:22
 * @LastEditors: snzo.chen
 * @LastEditTime: 2023-12-11 13:40:14
 */
import { request } from '@/utils/request';

/**
 * 查询所有用户
 * @param params
 * @returns
 */
export function selectAllChecker(params: API.PageParams) {
  return request<API.SeachResult<API.CheckerItem[]>>(
    {
      url: '/checker/selectAll',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

/**
 * 按ID 查找用户
 * @param params
 * @returns
 */
export function selectCheckerById(params: API.CheckerItem) {
  return request<API.SeachResult>(
    {
      url: '/checker/selectById',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

/**
 * 按条件查询数据
 * @param data
 * @param params
 * @returns
 */
export function selectCheckerByExample(data: API.CheckerItem, params: API.PageParams) {
  return request<API.SeachResult<API.CheckerItem[]>>(
    {
      url: '/checker/selectByExample',
      method: 'post',
      data,
      params,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

/**
 * 添加用户
 * @param params
 * @returns
 */
export function insertTicketChecker(data: API.CheckerItem) {
  return request<API.BaseResult>(
    {
      url: '/checker/insertTicketChecker',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

/**
 * 更新用户
 * @param params
 * @returns
 */
export function updateTicketChecker(data: API.CheckerItem) {
  return request<API.BaseResult>(
    {
      url: '/checker/updateTicketChecker',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * 删除用户
 * @param data
 * @returns
 */
export function deleteTicketChecker(data: API.CheckerItem) {
  return request<API.BaseResult>(
    {
      url: '/checker/deleteTicketChecker',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: true,
    },
  );
}
